﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace 考勤信息管理
{
    public partial class updateForm : Form
    {
        private SE _mse;
        private Form1 _mmainForm;
        public updateForm(Form1 mainForm,SE se)
        {
            InitializeComponent();
            this.txtId.Text = Convert.ToString(se.Id);
            this.txtage.Text = Convert.ToString(se.Age);
            this.txtName.Text = se.Name;
            if (se.Sex == "男")
            {
                this.comboBoxsex.SelectedIndex = 0;
            }
            else {
                this.comboBoxsex.SelectedIndex = 1;
            }
            this._mse = se;
            this._mmainForm = mainForm;
        }

        private void button1_Click(object sender, EventArgs e)
        {
         
            this._mse.Id = Convert.ToInt32(this.txtId.Text);
            this._mse.Age = Convert.ToInt32(this.txtage.Text);
            _mse.Name = this.txtName.Text;
            if (this.comboBoxsex.SelectedIndex == 0)
            {
                _mse.Sex = "男";
            }
            else {
                _mse.Sex = "女";
            }
            this._mmainForm.BindingData();
            this.Close();
        }
    }
}
